package cn.itcast.zt.java8.model.facade;

/**
 * 门面模式（外观模式） 门面包装
 * create by zhangtian105 on 2021/8/3
 */
public class SchoolFacade {
    private Door door;
    private Student student;
    private Teacher teacher;

    public SchoolFacade() {
        this.door = new Door();
        this.student = new Student();
        this.teacher = new Teacher();
    }

    public void doSchool() {
        door.open();
        student.goToSchool();
        teacher.beginClass();
        student.study();
        student.doWork();
        student.leaveSchool();
        teacher.endClass();
        student.leaveSchool();
        door.closs();
    }
}
